﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GDIT.BLL;
using System.Web.Script.Serialization;
using GDIT.Model;
using DevExpress.Xpo;

namespace GDIT.ashx
{
    /// <summary>
    /// PageService 的摘要说明
    /// </summary>
    public class PageService : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            /*显示的都是外部信息，到时候再改*/
            //context.Response.ContentType = "text/plain";
            //string action = context.Request["action"];
            //if (action == "getpagecount")
            //{
            //    BBulletinArticle bulletin = new BBulletinArticle();
            //    int count = bulletin.SelectTableConut();
            //    int pagecount = count / 10;//每一页10个数据项
            //    if (count % 10 != 0)
            //    {
            //        pagecount++;//不足一页自加一
            //    }
            //    context.Response.Write(pagecount);
            //}
            //else if (action == "getpagedata")
            //{
            //    string pagenum = context.Request["pagenum"];
            //    int iPageNum = Convert.ToInt32(pagenum);
            //    BBulletinArticle bulletin = new BBulletinArticle();
            //    JavaScriptSerializer jss = new JavaScriptSerializer();//是使用json来进行对象传送
            //    context.Response.Write(jss.Serialize(bulletin.selectBulletinBySqlAutoPaging((iPageNum - 1) * 10 + 1, (iPageNum) * 10)));
            //}
            //else if (action == "getindexpagedata")
            //{
            //    BBulletinArticle bulletin = new BBulletinArticle();
            //    JavaScriptSerializer jss = new JavaScriptSerializer();//使用Json来进行对像传送
            //    List<Mtb_BulletinArticle> result = bulletin.SelectBulletinArticleByTopAndImportant();
            //    context.Response.Write(jss.Serialize(result));
            //}
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}